home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1997 July
/
EnigmA AMIGA RUN 20 (1997)(G.R. Edizioni)(IT)[!][issue 1997-07 & 08][EAR-CD IV].iso
/
earcd
/
dev
/
amos
/
moreusel.lha
/
AnimHalve.AMOS
/
AnimHalve.amosSourceCode
Wrap
AMOS Source Code
|
1997-04-15
|
2KB
|
90 lines
' ***********************************
' * *
' * Animation Halve V1.0 *
' * Written by Chris Hodges. *
' * *
' ***********************************
'
Gosub INIT
Gosub MAKEANIM
End
INIT:
Screen Open 1,640,80,2,$8000
Curs Off : Flash Off : Paper 0 : Pen 1 : Cls
S$=Fsel$("","","Selektieren Sie das","000-Bild der Animation")
If S$="" Then End
S$=S$-"000"
T$=Fsel$("","","Geben Sie nun den neuen","Namen der Animation ein")
If T$="" Then End
Return
MAKEANIM:
A=0
Do
A$=""
If A<100 Then A$=A$+"0"
If A<10 Then A$=A$+"0"
A$=A$+Mid$(Str$(A),2)
Exit If Exist(S$+A$)=0
Load Iff S$+A$,0
WX=Screen Width : WY=Screen Height : AC=Screen Colour
If AC<4096
Screen Open 1,WX/2,WY/2,AC,0
Curs Off : Flash Off : Paper 0 : Pen 1 : Cls
Get Palette 0
Screen Display 1,288-WX/4,168-WY/4,WX/2,WY/2
Zoom 0,0,0,WX,WY To 1,0,0,WX/2,WY/2
Save Iff T$+A$
Screen Close 1
Else
For Y=0 To WY-1 Step 2
P=Colour(0) : MC0=P/$100 : MC1=(P and $F0)/16 : MC2=P mod 16
OC0=MC0 : OC1=MC1 : OC2=MC2
V0=0 : V1=0 : V2=0
For X=0 To WX-1
C=Point(X,Y) : Gosub SHAM
If(X and 1)=0
Gosub HAM
Plot X/2,Y/2,C
End If
Next
Next
Screen Open 1,WX/2,WY/2,4096,0
Curs Off : Flash Off : Paper 0 : Pen 1 : Cls
Get Palette 0
Screen Display 1,288-WX/4,168-WY/4,WX/2,WY/2
Screen Copy 0 To 1
Save Iff T$+A$
End If
Inc A
Loop
Return
SHAM:
If C<16 Then P=Colour(C) : MC0=P/$100 : MC1=(P and $F0)/16 : MC2=P mod 16 : Return
If C<32 Then MC2=C-16 : Return
If C<48 Then MC0=C-32 : Return
MC1=C-48
Return
HAM:
For C=0 To 15
If MC0*$100+MC1*16+MC2=Colour(C) Then Exit
Next
If C=16
Gosub ALGO
Else
V0=0 : V1=0 : V2=0
P=Colour(C) : MC0=P/$100 : MC1=(P and $F0)/16 : MC2=P mod 16
OC0=MC0 : OC1=MC1 : OC2=MC2
End If
Return
ALGO:
C=-1 : Gosub ALGO1
If C=-1 Then V0=0 : V1=0 : V2=0 : Gosub ALGO1
Return
ALGO1:
D0=Abs(OC0-MC0)-V0*8
D1=Abs(OC1-MC1)-V1*8
D2=Abs(OC2-MC2)-V2*8
If D0=>D1 and D0=>D2 Then C=32+MC0 : OC0=MC0 : Inc V0 : V1=0 : V2=0 : Return
If D1=>D0 and D1=>D2 Then C=48+MC1 : OC1=MC1 : Inc V1 : V0=0 : V2=0 : Return
If D2=>D0 and D2=>D1 Then C=16+MC2 : OC2=MC2 : Inc V2 : V0=0 : V1=0 : Return
Return